import { get,post } from '../../http/axios'

export default {
    // 命名空间
    namespaced:true,
    // 状态 -> data
    state:{
       role:{},
    },
    // 突变 -> 改变state中变量值的唯一方式
    mutations:{
        set_Allrole(state,val) {
            state.role = val;
        },
       
    },
    // 动作 -> methods，发送请求
    actions:{
        async Allrole({commit},params) {
            let res = await get('/baseUser/pageQuery',params);
            commit('set_Allrole',res.data);
           
        },
        async Save_role({commit},params) {
            let res = await post('/baseUser/saveOrUpdate',params);
            
            return res;
           
        },
        async Deleterole({commit},id) {
            let res = await get('/baseUser/deleteById',{id});
           
            return res;
        },
    }
}